/**
 * 
 */
package me.myachievements.web.goal;

import org.apache.wicket.markup.html.basic.Label;

import me.myachievements.persistence.goal.Goal;
import me.myachievements.web.MyAchievementsSession;

/**
 * @author besseym
 *
 */
public class CreateGoalForm extends GoalForm {

	/**
	 * @param id
	 * @param goal
	 */
	public CreateGoalForm(String id) {
		super(id, "Create Goal", new Goal());
	}
	
	@Override
	protected void onSubmit(){
		Goal goal = this.getModelObject();
		goal.setAccount(MyAchievementsSession.get().getAccount());
		this.goalPersistenceManager.create(goal);
	}

}
